home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Communication ToolBox / Outils CTB ƒ / CCL Modem Tool 1.2 ƒ / CCL Modem Tool / CCL Modem Tool.rsrc / TEXT_20000_Hayes 1200_2400.txt < prev    next >
Encoding:
Text File  |  1993-03-11  |  2.2 KB  |  165 lines

  1. ! Default Hayes Script - 06 June 1992
  2. !
  3. @ORIGINATE
  4. @ANSWER
  5. !
  6. @LABEL 1
  7. serreset 2400, 0, 8, 1
  8. !
  9. ! Load Factory configurations
  10. !
  11. @LABEL 2
  12. matchclr
  13. matchstr 1 3 "OK\13\10"
  14. write "AT&F\13"
  15. matchread 40
  16. jump 59
  17. !
  18. !    Set up the configuration:
  19. !    Echo off
  20. !
  21. @LABEL 3
  22. matchstr 1 4 "OK\13\10"
  23. write "ATE0\13"
  24. matchread 30
  25. jump 59
  26. !
  27. ! Next, reset on DTR transition, set direct mode
  28. !
  29. @LABEL 4
  30. matchstr 1 5 "OK\13\10"
  31. write "AT&D3\13"
  32. matchread 30
  33. jump 59
  34. !
  35. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  36. !
  37. @LABEL 5
  38. ifstr 2 8 "1"
  39. note "Speaker Off"
  40. pause 10
  41. matchstr 1 8 "OK"
  42. write "ATM0\13"
  43. matchread 30
  44. jump 59
  45. !
  46. ! The modem is ready so enable answering, or originate a call
  47. !
  48. @LABEL 8
  49. pause 10
  50. ifANSWER 30
  51. !
  52. ! @ORIGINATE
  53. !
  54. note "Dialing ^1" 3
  55. write "ATS7=90D^1\13"
  56. !
  57. @LABEL 9
  58. JSR 80
  59. matchread 700
  60. jump 59
  61. !
  62. !
  63. ! @ANSWER
  64. ! Set up the modem to answer
  65. @LABEL 30
  66. write "ATS0=1\13"
  67. matchstr 1 31 "OK\13\10"
  68. matchread 30
  69. jump 59
  70. !
  71. @LABEL 31
  72. jsr 80
  73. matchstr 16  32 "RING\13\10"
  74. matchread 700
  75. jump 31
  76. !
  77. @LABEL 32
  78. userhook 1
  79. note "Answering phone‚Ķ" 2
  80. jump 31
  81. !
  82. ! Standard responses
  83. !
  84. @LABEL 80
  85. matchclr
  86. matchstr 1 11 "CONNECT 1200\13\10"
  87. matchstr 2 12 "CONNECT 2400\13\10"
  88. matchstr 3 50 "NO CARRIER\13\10"
  89. matchstr 4 50 "ERROR\13\10"
  90. matchstr 5 52 "NO DIALTONE\13\10"
  91. matchstr 6 53 "BUSY\13\10"
  92. matchstr 7 54 "NO ANSWER\13\10"
  93. return
  94. !
  95. ! Connection established
  96. !
  97. @LABEL 11
  98. note "Communicating at 1200 bps." 2
  99. !serreset 1200, 0, 8, 1
  100. jump 15
  101. !
  102. @LABEL 12
  103. note "Communicating at 2400 bps." 2
  104. serreset 2400, 0, 8, 1
  105. !
  106. @LABEL 15
  107. ifANSWER 16
  108. pause 20
  109. @LABEL 16
  110. exit 0
  111. !
  112. ! 50: error messages
  113. ! No carrier
  114. @LABEL 50
  115. exit -6021
  116. ! No Dial Tone
  117. @LABEL 52
  118. exit -6020
  119. ! Busy
  120. @LABEL 53
  121. exit -6022
  122. ! No Answer
  123. @LABEL 54
  124. exit -6023
  125. ! Modem error
  126. @LABEL 59
  127. exit -6019
  128. !
  129. ! Hang up the modem
  130. !
  131. @HANGUP
  132. Note "Disconnecting‚Ķ"
  133. @LABEL 60
  134. settries 0
  135. @LABEL 61
  136. write "ATH0\13"
  137. matchclr
  138. matchstr 1 62 "\13\10NO CARRIER\13\10"
  139. matchstr 2 62 "OK\13\10"
  140. matchstr 3 62 "ERROR\13\10"
  141. matchread 30
  142. inctries
  143. iftries 3 62
  144. ! no response, try escape sequence
  145. write "+++"
  146. matchclr
  147. matchstr 1 61 "OK\13\10"
  148. matchread 15
  149. ! try dropping DTR
  150. DTRClear
  151. pause 10
  152. DTRSet
  153. pause 10
  154. jump 61
  155. !
  156. ! Recall the factory settings
  157. !
  158. @LABEL 62
  159. write "AT&F\13"
  160. matchclr
  161. matchstr 1 63 "OK\13\10"
  162. matchread 30
  163. !
  164. @LABEL 63
  165. exit 0